<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Installation</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mysqlnd.overview.html">« Overview</a></li>
      <li style="float: right;"><a href="mysqlnd.config.html">运行时配置 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.mysqlnd.html">Mysqlnd</a></li>
    <li>Installation</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mysqlnd.install" class="chapter">

  <h1>Installation</h1>


  <p class="para">
    <em class="emphasis">Installation on Unix</em>
  </p>

  <p class="para">
    In order to use the MySQL Native Driver, PHP needs
    to be built specifying that the MySQL database extensions are
    compiled with MySQL Native Driver support. This is done through
    configuration options prior to building the PHP source code.
  </p>

  <p class="para">
    For example, to build the MySQL extension, <code class="literal">mysqli</code>
    and PDO MYSQL using the MySQL Native Driver, the following command
    would be given:
  </p>

<div class="example-contents">
<div class="shellcode"><pre class="shellcode">./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
[other options]</pre>
</div>
</div>


  <p class="para">
    <em class="emphasis">Installation on Windows</em>
  </p>

  <p class="para">
    In the official PHP Windows distributions, MySQL Native
    Driver is enabled by default, so no additional configuration is
    required to use it. All MySQL database extensions will use MySQL
    Native Driver in this case.
  </p>

  <p class="para">
    <em class="emphasis">SHA-256 Authentication Plugin support</em>
  </p>

  <p class="para">
    The MySQL Native Driver requires the OpenSSL functionality of PHP to be loaded
    and enabled to connect to MySQL through accounts that use the MySQL SHA-256
    Authentication Plugin. For example, PHP could be configured using:
  </p>

<div class="example-contents">
<div class="shellcode"><pre class="shellcode">./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl
[other options]</pre>
</div>
</div>


</div>
</div></div></body></html>